﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Algorithms;
using Algorithms.Depth;
using Algorithms.WidthSearch;
using Algorithms.LDepthStrategy;
using Algorithms.IDepthSearch;
using Algorithms.Bidirectional;
using Algorithms.HillClimbing;
using Operators.CMOperators;
using Operators.WaterCupOperators;
using Operators;
using Satates.CMStates;
using Satates.FarmerStates;
using Satates.WaterCupState;

namespace PresentationWpf.TemplateMethod
{
     public  class ConcreteTemplate:AbstractClass
    {
        public override Algorithms.iStrategy GetStrategy(string strategy)
        {
            iStrategy Strategy = new DepthStrategy();
            switch (strategy)
            {
                case "DepthStrategy":
                    Strategy = new DepthStrategy();
                    break;
                case "WidthStrategy":
                    Strategy = new WidthStrategy();
                    break;
                case "LDepthStrategy":
                    Strategy = new LDepthStrategy();
                    break;
                case "IDepthStrategy":
                    Strategy = new IDepthStrategy();
                    break;
                case "BidirectionalStrategy":
                    Strategy = new BidirectionalStrategy();
                    break;
                case "hill":
                    HillClimbingStrategy hill = new HillClimbingStrategy();
                    hill.setHeuristic(new WaterCupHeuristic());
                    Strategy = hill;
                    break;
                default: break;
            }
            return Strategy;
        }

        public override Satates.State GetInitialState(string state)
        {

            switch (state)
            {
                case "WaterCups":
                    return WaterCupState.initalState();
                    break;
                case "Farmer":
                    return FarmerStates.initalState();
                    break;
                case "CM":
                    return CMState.initalState();
                    break;

            }
            return null;
        }

        public override List<Satates.State> GetFinalsStates(string state)
        {
            switch (state)
            {
                case "WaterCups":
                    return WaterCupState.finalStates();
                    break;
                case "Farmer":

                    return FarmerStates.finalStates();

                    break;
                case "CM":

                    return CMState.finalStates();

                    break;

            }
            return null;
        }

        public override List<iOperator> GetListOperators(string state)
        {
            switch (state)
            {
                case "WaterCups":                   
                    return WaterCupOperators.returnOperators();
                    break;
                case "Farmer":
                    return FarmerOperators.returnOperators();
                    break;
                case "CM":
                    return CMOperators.returnOperators();
                    break;

            }
            return null;
        }
    }
}
